<?php
class DigFile_Form_Image extends DigFile_Form_File
{
    public function init() {
        $this->addElement('text', 'alt_text', array(
            'label'     => 'Alt Text',
            'description'   => 'This is the default alt text for the image.'
        ));
        $this->addElement('image', 'preview', array(
            'label'     => "Image Preview",
            'order'  => 10
        ));
    }

    public function populate($data) {
        $preview = $this->getElement('preview');
        if($data instanceof DigFile_Model_Resource) {
            $preview->setImage($data->filepath());
        }
        parent::populate($data);
    }
}
?>